import request from '@/config/axios'

//获取数据库资产列表
export const getDataBaseList = async (params) => {
  return await request.getOriginal({
    url: '/amp/asset-message/page',
    params
  })
}
export const assetMessageUploadFinger = async (data) => {
  return await request.upload({
    url: '/amp/asset-message/upload-finger',
    data
  })
}
export const assetMessageTransferDept = async (data) => {
  return await request.post({
    url: '/amp/asset-message/transferDept',
    data
  })
}
export const assetMessageTransferSys = async (data) => {
  return await request.post({
    url: '/amp/asset-message/transferSys',
    data
  })
}
//获取数据库资产列表
export const getDataBasePassList = async (params) => {
  return await request.getOriginal({
    url: '/amp/asset-message-pass/page',
    params
  })
}
//获取数据库资产详情
export const getAssetDetail = async (params) => {
  return await request.getOriginal({
    url: '/amp/asset-message/get',
    params
  })
}
// 数据资产删除
export const assetDel = async (id) => {
  return await request.delete({
    url: '/amp/asset-message/delete?id=' + id
  })
}
// 数据资产批量删除
export const assetListDel = async (data) => {
  return await request.put({
    url: '/amp/asset-message/deletes',
    data
  })
}
// 待确认数据资产删除
export const pendingAssetDel = async (id) => {
  return await request.getOriginal({
    url: '/amp/asset-message/unSubmitEnsure?id=' + id
  })
}
// 待确认数据资产批量删除
export const pendingAssetListDel = async (data) => {
  return await request.postOriginal({
    url: '/amp/asset-message/unSubmitEnsureByIds',
    data
  })
}

// 监控管理平台数据管理数据资产确认
export const monitorAssetEnsure = async (data) => {
  return await request.postOriginal({
    url: '/amp/asset-message/submitEnsure-source5',
    data
  })
}

// 数据资产确认
export const assetEnsure = async (params) => {
  return await request.getOriginal({
    url: '/amp/asset-message/submitEnsure',
    params
  })
}
// 数据资产批量确认
export const assetListEnsure = async (data) => {
  return await request.postOriginal({
    url: '/amp/asset-message/submitEnsureByIds',
    data
  })
}
// 数据资产批量确认
export const assetPageByLevelCount = async (params) => {
  return await request.get({
    url: '/amp/asset-message/pageByLevelCount',
    params
  })
}
// 数据资产复核
export const assetRecheck = async (data) => {
  return await request.put({
    url: '/amp/asset-message/recheck',
    data
  })
}
// 分类分级数量统计DB
export const assetLevelCountDB = async (params) => {
  return await request.get({
    url: '/amp/asset-message/levelCountDB',
    params
  })
}
// 分类分级数量统计File
export const assetLevelCountFile = async (params) => {
  return await request.get({
    url: '/amp/asset-message/levelCountFile',
    params
  })
}
// 分类分级数量统计File
export const filePageByLevelCount = async (params) => {
  return await request.get({
    url: '/amp/asset-message/pageByLevelCount',
    params
  })
}
//上传文件
export const assetUploadFile = async (data) => {
  return await request.post({
    url: '/amp/asset-message/uploadFile',
    data
  })
}
//上传文件2
export const assetUploadFile2 = async (data) => {
  return await request.post({
    url: '/amp/asset-message/uploadFile2',
    data,
    timeout: 66666
  })
}
//创建
export const assetMessageCreate2 = async (data) => {
  return await request.post({
    url: '/amp/asset-message/create2',
    data
  })
}
export const assetMessageCreate2AutoAudit = async (data) => {
  return await request.post({
    url: '/amp/asset-message/create2AutoAudit',
    data
  })
}
//导入资产信息 Excel
export const assetMessageImportExcel = async (data) => {
  return await request.post({
    url: '/amp/asset-message/import-excel',
    data
  })
}
//导出excel
export const assetMessageExportExcel = async (params) => {
  return await request.download({
    url: '/amp/asset-message/export-excel',
    params
  })
}

//导出excel（新）
export const newAssetMessageExportExcel = async (params) => {
  return await request.download({
    url: '/amp/asset-message/export-excel-file-datatype',
    params
  })
}

//文件资产导出excel
export const assetMessageExportExcelFile = async (params) => {
  return await request.download({
    url: '/amp/asset-message/export-excel-file',
    params
  })
}
//批量复核
export const assetMessageRechecks = async (data) => {
  return await request.put({
    url: '/amp/asset-message/rechecks',
    data
  })
}

// 数据源接口
//获取数据源资产列表
export const getDataSourcePage = async (params) => {
  return await request.getOriginal({
    url: '/amp/asset-data-source/page',
    params
  })
}
//获取数据源资产详情
export const getDataSourceDetail = async (params) => {
  return await request.getOriginal({
    url: '/amp/asset-data-source/get',
    params
  })
}
//获取数据源资产详情
export const dataSourceUpdate2 = async (data) => {
  return await request.put({
    url: '/amp/asset-data-source/update2',
    data
  })
}
//资产提交确认
export const assetSubmitEnsure = async (params) => {
  return await request.getOriginal({
    url: '/amp/asset-data-source/submitEnsure',
    params
  })
}
//资产批量提交确认
export const assetSubmitEnsureByIds = async (data) => {
  return await request.postOriginal({
    url: '/amp/asset-data-source/submitEnsureByIds',
    data
  })
}
//数据资产源删除
export const assetDelete = async (id) => {
  return await request.delete({
    url: '/amp/asset-data-source/delete?id=' + id
  })
}
//数据资产源批量删除
export const assetListDelete = async (data) => {
  return await request.delete({
    url: '/amp/asset-data-source/deleteAll',
    data
  })
}
//待确认数据资产源删除
export const pendingAssetDelete = async (id) => {
  return await request.getOriginal({
    url: '/amp/asset-data-source/unSubmitEnsure?id=' + id
  })
}
//待确认数据资产源批量删除
export const pendingAssetListDelete = async (data) => {
  return await request.postOriginal({
    url: '/amp/asset-data-source/unSubmitEnsureByIds',
    data
  })
}
// 数据源导出
export const assetSourceExport = async (params) => {
  return await request.download({
    url: '/amp/asset-data-source/export-excel',
    params
  })
}

// 数据源提交审批
export const assetSourceAudit = async (params) => {
  return await request.post({
    url: '/amp/asset-data-source/audit',
    params
  })
}
// 数据源提交审批
export const assetSourceCancel = async (params) => {
  return await request.post({
    url: '/amp/asset-data-source/cancel',
    params
  })
}
// 数据源提交审批
export const assetSourceAuditBatch = async (data) => {
  return await request.post({
    url: '/amp/asset-data-source/auditBatch',
    data
  })
}

// 文件提交审批
export const fileAudit = async (params) => {
  return await request.post({
    url: '/amp/asset-message/audit',
    params
  })
}
// 文件提交审批
export const fileCancel = async (params) => {
  return await request.post({
    url: '/amp/asset-message/cancel',
    params
  })
}
// 文件服务器文件提交确认
export const assetMessageRemoteFromDatasource = async (id) => {
  return await request.put({
    url: `/amp/asset-message/remoteFromDatasource?id=${id}`
  })
}

export const assetMessageRemoteManyFromDatasource = async (data) => {
  return await request.post({
    url: `/amp/asset-message/remoteFromManyDatasource`,
    data
  })
}
// 文件批量提交审批
export const fileAuditBatch = async (data) => {
  return await request.post({
    url: '/amp/asset-message/auditBatch',
    data
  })
}

// 获得文件分析任务结果中的标签信息分页
export const fileParseResultLabelPage = async (params) => {
  return await request.getOriginal({
    url: '/amp/file-parse-result-label/page',
    params
  })
}
// 获得文件分析任务结果中的样例数据分页
export const fileParseResultSamplePage = async (params) => {
  return await request.getOriginal({
    url: '/amp/file-parse-result-sample/page',
    params
  })
}

// 分类分级
export const assetExecClassification = async (data) => {
  return await request.post({
    url: '/amp/collection-asset/exec/classification',
    data
  })
}

// 阻塞分类分级
export const assetExecClassificationAsync = async (data) => {
  return await request.post({
    url: '/amp/collection-asset/exec/classification/sync',
    data,
    timeout: 600000
  })
}

// 批量获取资产详细信息
export const getBatchAssetInfo = async (params) => {
  return await request.get({
    url: '/amp/asset-message/getIds',
    params
  })
}

//数据库详情新增表和字段
export const addTableAndField = async (data) => {
  return await request.put({
    url: '/amp/asset-message/add',
    data
  })
}

//待确认文件资产克隆
export const clonePeddingFile = async (data) => {
  return await request.post({
    url: '/amp/asset-message/copy',
    data
  })
}

//待确认数据库资产克隆
export const clonePeddingDb = async (data) => {
  return await request.post({
    url: '/amp/asset-data-source/copy',
    data
  })
}
